#include "stdafx.h"
#include "test.h"

Test::Test(){};

void Test::Card_Test()
{
	/*
	Card test;
	if ( test.Empty())
	{
		cout<<"empty card!"<<endl;
	}
	Card obj = test ;
	if( *obj.getFace()==EMPTY)
		cout<<"EMPTY";
	obj.Set((char)0x05);
	cout<<endl<<obj.getFace()<<endl;
	char suit = 0x01;
	cout<<suit<<endl;
	obj.Set(10,3);
	cout<<"obj's Face:"<<obj.getFace()<<endl;
	obj.Set(2,2);
	obj.Swap(test);
	cout<<"test's Face:"<<test.getFace()<<endl;
	test.getSuit();
	obj = test;
	*/
}

void Test::Array_Test()
{
	Array<int> ary(4);
	cout<<"size is:"<<ary.Size()<<endl;
	for ( int  i = 0 ; i<ary.Size();++i)
		ary[i] = i+1;
	
	cout<<"contain size is:"<<ary.ContainsCount( 1 ) <<endl;
	cout<<"clear result is:"<<ary.Clear( 1 ) <<endl;
	
	ary.Resize(10);

}

void Test::CardBox_Test()
{
	CardBox demo;
	cout<<"size is :"<<demo.Size()<<endl;
	for ( int  i = 0 , n = demo.Size(); i < n ; ++i )
	{
		cout<<demo[i].Face()<<'\t';
		if ((i+1)%13==0)
		{
			cout<<endl;
		}
	}

	for ( int i = 0 , n = demo.Size(); i < n ; ++i )
	{
		cout<<demo.Rand().Face()<<'\t';
		if ((i+1)%13==0)
		{
			cout<<endl;
		}
	}
	CardBox a ;
	cout<<a.Size()<<endl;
}

void Test::BlackJack_Test()
{
	Blackjack bj;
	bj.BjDemo();
	bj.Set(11,3);
	cout<<bj.Value()<<endl;
	cout<<bj.Face()<<endl;
}

void Test::Player_Test()
{
	Player player ;
	player.pDemo();
}